#include "TestCommonPage.h"

void TestCommonPage::testSetMusicListType()
{
    CommonPage commonPage;
    commonPage.setMusicListType(PageType::LIKE_PAGE);
    // 这里可以添加更多验证逻辑，比如获取pageType并验证
    QVERIFY(true);
}

void TestCommonPage::testSetCommonPageUI()
{
    CommonPage commonPage;
    QString text = "测试标题";
    QString imagePath = ":/images/test.png";
    commonPage.setCommonPageUI(text, imagePath);
    // 这里可以添加更多验证逻辑，比如检查标题和图片是否正确设置
    QVERIFY(true);
}

void TestCommonPage::testAddMusicToMusicPage()
{
    CommonPage commonPage;
    MusicList musicList;
    // 可以添加一些测试用的音乐到musicList
    commonPage.setMusicListType(PageType::LOCAL_PAGE);
    commonPage.addMusicToMusicPage(musicList);
    // 这里可以添加更多验证逻辑，比如检查musicOfPage是否正确更新
    QVERIFY(true);
}

void TestCommonPage::testReFresh()
{
    CommonPage commonPage;
    MusicList musicList;
    commonPage.setMusicListType(PageType::LOCAL_PAGE);
    commonPage.reFresh(musicList);
    // 这里可以添加更多验证逻辑，比如检查界面是否正确更新
    QVERIFY(true);
}

void TestCommonPage::testAddMusicToPlaylist()
{
    CommonPage commonPage;
    MusicList musicList;
    QMediaPlaylist playList;
    commonPage.setMusicListType(PageType::LOCAL_PAGE);
    commonPage.addMusicToPlaylist(musicList, &playList);
    // 这里可以添加更多验证逻辑，比如检查播放列表是否正确更新
    QVERIFY(true);
}

/*int main(int argc, char *argv[])
{
    QCoreApplication app(argc, argv);
    TestCommonPage test;
    int result = QTest::qExec(&test, argc, argv);
    return result;
}*/
